using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ShoreController
{
    Shore shoreModel;
    public void CreateShore(Vector3 position)
    {
        if (shoreModel == null)
        {
            shoreModel = new Shore(position);
        }
    }

    public Shore GetShore()
    {
        return shoreModel;
    }

    // 添加角色上岸，返回岸上坐标
    public Vector3 AddRole(Role roleModel) {
        Transform childTransform = roleModel.role.transform;
        childTransform.SetParent(null);
        roleModel.inBoat = false;
        if (roleModel.isPriest) shoreModel.priestCount++;
        else shoreModel.devilCount++;
        if (shoreModel.shore.transform.position.x > 0)
            return Position.role_shore_right[roleModel.id];
        else return Position.role_shore_left[roleModel.id];
    }
    
    //将角色从岸上移除
    public void RemoveRole(Role roleModel) {
        if (roleModel.isPriest) shoreModel.priestCount--;
        else shoreModel.devilCount--;
    }
}
